<!DOCTYPE html>
<html class="x-admin-sm">
    
    <head>
        <meta charset="UTF-8">
        <title>查看设备</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
        <link rel="stylesheet" href="__HOME_CSS__/font.css">
        <link rel="stylesheet" href="__HOME_CSS__/xadmin.css">
        <script src="__HOME_JS__/echarts.min.js"></script>
        <script src="__HOME_LIB__/layui/layui.js" charset="utf-8"></script>
        <script type="text/javascript" src="__HOME_JS__/xadmin.js"></script>
        <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
        <!--[if lt IE 9]>
            <script src="__HOME_JS__/html5.min.js"></script>
            <script src="__HOME_JS__/respond.min.js"></script>
        <![endif]-->
    </head>
    <body>
        <div class="layui-fluid">
            <div class="layui-row">
                <div class="layui-card-body layui-table-body layui-table-main">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>柜门编号</th>
                            <th>设备类别</th>
                            <th>设备名称</th>
                            <th>设备型号</th>
                            <th>柜门编号</th>
                            <th>柜子状态</th>
                            <th>门锁状态</th>
                            <th>空闲中</th>
                            <th>充电中</th>
                            <th>设备列表</th>
                            <th>编辑柜门</th>
                        </thead>
                        <tbody>
                        {volist name="door" id="vo"}
                        <tr>
                            <td>{$vo.door_serial}</td>
                            <td>{$vo.device_category_text}</td>
                            <td>{$vo.device_name}</td>
                            <td>{$vo.device_model}</td>
                            <td>{$vo.door_serial}</td>
                            <td>{$vo.status_text}</td>
                            <td>{$vo.lock_status_text}</td>
                            <td>{$vo.free}</td>
                            <td>{$vo.charge}</td>
                            <td><a title="查看"  onclick="xadmin.open('设备列表','{:url('index/door/device_of_door?door_id='.$vo.id)}')" href="javascript:;">
                                <i class="layui-icon">查看设备</i>
                            </a></td>
                            <td><a title="查看"  onclick="xadmin.open('编辑柜门','{:url('index/door/door_edit?door_id='.$vo.id)}',650,500)" href="javascript:;">
                                <i class="layui-icon">编辑柜门</i>
                            </a></td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <script>layui.use(['form', 'layer','jquery'],
            function() {
                $ = layui.jquery;
                var form = layui.form,
                layer = layui.layer;

                //自定义验证规则
                form.verify({
                    nikename: function(value) {
                        if (value.length < 5) {
                            return '昵称至少得5个字符啊';
                        }
                    },
                    pass: [/(.+){6,12}$/, '密码必须6到12位'],
                    repass: function(value) {
                        if ($('#L_pass').val() != $('#L_repass').val()) {
                            return '两次密码不一致';
                        }
                    }
                });

                //监听提交
                form.on('submit(add)',
                function(data) {
                    //发异步，把数据提交给php
                    layer.msg("增加成功", {
                        icon: 6
                    },
                    function() {
                        //关闭当前frame
                        xadmin.close();

                        // 可以对父窗口进行刷新 
                        xadmin.father_reload();
                    });
                    return false;
                });

            });</script>
    </body>

</html>